package com.brush.system.domain.req.logininfor;

import cn.hutool.core.util.StrUtil;
import com.brush.common.core.domain.page.PageAbstructReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * 登录日志查询请求对象
 */
@Getter
@Setter
@ApiModel(value = "SysLogininforQueryReq",description = "登录日志查询请求对象")
public class SysLogininforQueryReq extends PageAbstructReq {

    /**
     * 登录IP地址
     */
    @ApiModelProperty(value = "登录IP地址")
    private String ipaddr;

    /**
     * 用户账号
     */
    @ApiModelProperty(value = "用户账号")
    private String userName;

    /**
     * 登录状态（0成功 1失败）
     */
    @ApiModelProperty(value = "登录状态（0成功 1失败）")
    private String status;

    @ApiModelProperty(value = "开始时间" )
    private Date beginTime;

    @ApiModelProperty(value = "结束时间" )
    private Date endTime;


    @ApiModelProperty(hidden = true)
    @Override
    public String getOrderBy() {
        if(StrUtil.isNotBlank(super.getOrderByColumn())){
            return super.getOrderByColumn() + " " + super.getIsAsc();
        }
        return null;
    }
}
